import axios from 'axios'
export default {
    namespaced: true,
    state: {
        arr: [],
        
    },
    mutations: {
        SETARR(state, payload) {
            state.arr = []
            payload.forEach(item => {
                let obj = {
                    left: Math.floor(Math.random() * (851)),
                    top: Math.floor(Math.random() * (401)),
                    ...item
                }
                state.arr.push(obj)
            })
        },


    },
    actions: {
        async GETMSG(context, payload) {
            await axios.get('http://chst.vip:1902/students/getstulist')
                .then(res => {
                    // console.log(res);

                    context.commit('SETARR', res.data.data)
                })
        },

    },
    getters: {

    }
}